<?php
class connectDB
{
    private $username = 'root',$password = 'vertrigo', $location = 'localhost', $db = 'CV';
    private $connect; //mysql resource
    private $table; //

    function __construct()
    {
        $this->connect = mysql_connect($this->location, $this->username, $this->password) or die ("Could not connect to database");
        $this->table = mysql_select_db($this->db, $this->connect) or die ("could not select database");
        return true;
    }

    function switchDB($dbNaam)
    {
        mysql_close($this->connect);
        $this->connect = mysql_connect($location, $username, $password) or die ("Could not connect to database");
        if($this->switchTable($dbNaam) == true)
        {	return true;	}
    }
    function switchTable($dbNaam)
    {
        $this->table = mysql_select_db($dbNaam, $this->connect);
        return true;
    }
}
?>